import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-news',
  templateUrl: './news.component.html',
  styleUrls: ['./news.component.less']
})
export class NewsComponent implements OnInit {
   
  //声明数组,放每条新闻
  list:any[]=[];
  constructor() { }

  ngOnInit():void {

    for(var i=1; i<11;i++){
       this.list.push("这是第"+i+"条新闻")
    }
  }

}
